package com.excellent.search.pojo;

import com.excellent.common.PageResult;
import com.excellent.item.pojo.Brand;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author Xxacker
 */
@Data
public class SearchResult extends PageResult<Goods> {

    private List<Map<String, Object>> categories;    //分类结果集字段；categories中的字段太多，字段越多，会影响网络的带宽

    private List<Brand> brands;                      //品牌结果集对象；id、Logo、名称

    private List<Map<String, Object>> specs;         //规格参数聚合结果

    public SearchResult() {
    }

    public SearchResult(List<Map<String, Object>> categories, List<Brand> brands, List<Map<String, Object>> specs) {
        this.categories = categories;
        this.brands = brands;
        this.specs = specs;
    }

    public SearchResult(Long total, List<Goods> items, List<Map<String, Object>> categories, List<Brand> brands, List<Map<String, Object>> specs) {
        super(total, items);
        this.categories = categories;
        this.brands = brands;
        this.specs = specs;
    }

    public SearchResult(Long total, Integer totalPage, List<Goods> items, List<Map<String, Object>> categories, List<Brand> brands, List<Map<String, Object>> specs) {
        super(total, totalPage, items);
        this.categories = categories;
        this.brands = brands;
        this.specs = specs;
    }
}
